#案例
#带查询参数的get请求，使用requests库，请求tpshop商城搜索商品接口
#查询iPhone，请求url是:
#http://127.0.0.1/index.php/Home/Goods/search.html?q=iphone
#导包
import requests

resp=requests.get(url="http://127.0.0.1/index.php/Home/Goods/search.html",
                  params={"q":"iphone"})
print(resp.text)
print(resp.json())
print(resp.status_code)
print(resp.cookies)
print(resp.url)
print(resp.headers)
print(resp.encoding)